package com.baic.ibasedeviceclient;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baic.ibasedeviceclient.config.MqttConfig;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;



@SpringBootApplication
public class IbaseDeviceClientApplication implements CommandLineRunner {

    private static final Logger log = LoggerFactory.getLogger(IbaseDeviceClientApplication.class);

    @Autowired
    private MqttConfig mqttConfig;

    public static void main(String[] args) {

        SpringApplication.run(IbaseDeviceClientApplication.class, args);

    }

    @Override
    public void run(String... args) throws Exception {
      log.info("MqttConfig:{}", JSONObject.from(mqttConfig).toJSONString());
    }
}
